const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            photo,
            page: {
                ProvinceNumber: '',
                activeName: 'first',
                value1: '',
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%,%%")))
            },
            str1: '',
            str: '',
        }
    },
    mounted() {

    },
    methods: {
        Treedata() {
            const _this = this;
            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryBySQLSerialNumber`,
                method: "post",
                data: {
                    SQLSerialNumber: 't_article_exchange_address',
                    Condition: window.btoa(unescape(encodeURIComponent("%%"))),
                    ExtensionCondition: '',
                },
                success: (data) => {
                    this.treeData = data;
                },
                complete: (XMLHttpRequest) => {
                    requestPretreatment(XMLHttpRequest)
                },
            })
        },
        handleNodeClick(data, node) {
            if (this.page.ProvinceNumber && this.page.ProvinceNumber == data.Article_Exchange_SerialNumber) {
                this.page.ProvinceNumber = '';
            } else {
                this.page.ProvinceNumber = data.Article_Exchange_SerialNumber;
            }
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,%" + this.page.ProvinceNumber + "%")))
            this.postgetList(this.page);
        },
        check() {
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,%" + this.page.ProvinceNumber + "%")))
            this.postgetList(this.page);
        },
        handleEnter(row){
            let { primary_key } = JSON.parse(document.getElementById("table").getAttribute("data-options"));
            window.location.href = "./enter.html?action=Add&nodeKey=" + row[primary_key];
        },
        handleOut(row){
            let { primary_key } = JSON.parse(document.getElementById("table").getAttribute("data-options"));
            window.location.href = "./out.html?action=Add&nodeKey=" + row[primary_key];
        },
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");
